<?php

Class Wall extends Connect{
    
    function add($user, $parent){
        $sql = "INSERT INTO `".PREFIX_TABLE."wall` (`parent`, `user`) 
                VALUES 
                ('".$parent."', '".$user."')" ;
        if(!$result = DBConnect::query($sql)){
            #return $glade;
            $this->_error(mysql_error());
            return false;
        }
        return mysql_insert_id();
    }
    
    function get($postId){
        $sql = "SELECT * FROM `".PREFIX_TABLE."wall` WHERE `id` = '".$postId."' LIMIT 1 ";        
        if(!$result = DBConnect::query($sql)){
            #return $glade;
            $this->_error(mysql_error());
            return false;
        }
        return DBConnect::getOne($result);
    }
}
?>